package hc.um.action;

import java.util.Vector;

class Payment {
	public int sum;

	public Payment(int sum) {
		this.sum = sum;
	}
}

public class Main_Class {

	public static void main(String[] args) {
		Vector<Payment> payments = new Vector<Payment>();
		payments.add(new Payment(100));
		payments.add(new Payment(50));
		//payments.add(new Payment(20));

		System.out.println("sum= " + recursive_sum(payments, 0));
	}

	public static int recursive_sum(Vector<Payment> payVec, int index) {
		
		if (index == payVec.size()-1)
			return payVec.get(index).sum;
		else 
			return recursive_sum(payVec, index+1)+payVec.get(index).sum;
	}
}
